package com.docmgmt.mvp.constant;

/**
 * 权限常量类（v3.0 RBAC）
 *
 * 根据docs/01-系统需求规格说明书.md和docs/04-数据库设计文档.md
 * 定义28个标准权限代码
 *
 * @author Dora
 */
public class PermissionConstants {

    // ==================== 文件管理权限 (8个) ====================
    /** 查看文件 */
    public static final String FILE_READ = "file:read";
    /** 上传文件 */
    public static final String FILE_CREATE = "file:create";
    /** 修改文件（重命名、移动） */
    public static final String FILE_UPDATE = "file:update";
    /** 删除文件 */
    public static final String FILE_DELETE = "file:delete";
    /** 下载文件 */
    public static final String FILE_DOWNLOAD = "file:download";
    /** 分享文件 */
    public static final String FILE_SHARE = "file:share";
    /** 设置文件隐私级别 */
    public static final String FILE_SET_PRIVACY = "file:set_privacy";
    /** 查看文件操作历史 */
    public static final String FILE_VIEW_HISTORY = "file:view_history";

    // ==================== 文件夹管理权限 (5个) ====================
    /** 查看文件夹 */
    public static final String FOLDER_READ = "folder:read";
    /** 创建文件夹 */
    public static final String FOLDER_CREATE = "folder:create";
    /** 修改文件夹（重命名） */
    public static final String FOLDER_UPDATE = "folder:update";
    /** 删除文件夹 */
    public static final String FOLDER_DELETE = "folder:delete";
    /** 管理文件夹权限 */
    public static final String FOLDER_MANAGE_PERMISSION = "folder:manage_permission";

    // ==================== 知识库管理权限 (7个) ====================
    /** 查看知识库 */
    public static final String KB_READ = "kb:read";
    /** 创建知识库 */
    public static final String KB_CREATE = "kb:create";
    /** 修改知识库配置 */
    public static final String KB_UPDATE = "kb:update";
    /** 删除知识库 */
    public static final String KB_DELETE = "kb:delete";
    /** 添加文件到知识库 */
    public static final String KB_ADD_FILE = "kb:add_file";
    /** 从知识库移除文件 */
    public static final String KB_REMOVE_FILE = "kb:remove_file";
    /** 手动触发知识库同步 */
    public static final String KB_TRIGGER_SYNC = "kb:trigger_sync";

    // ==================== AI问答权限 (3个) ====================
    /** 使用AI问答（基础） */
    public static final String AI_CHAT = "ai:chat";
    /** 查看AI对话历史 */
    public static final String AI_VIEW_HISTORY = "ai:view_history";
    /** 删除AI对话 */
    public static final String AI_DELETE_CONVERSATION = "ai:delete_conversation";

    // ==================== 用户管理权限 (3个) ====================
    /** 查看用户列表 */
    public static final String USER_READ = "user:read";
    /** 创建用户 */
    public static final String USER_CREATE = "user:create";
    /** 修改用户信息（含角色分配） */
    public static final String USER_UPDATE = "user:update";

    // ==================== 系统管理权限 (2个) ====================
    /** 查看审计日志 */
    public static final String SYSTEM_VIEW_AUDIT_LOG = "system:view_audit_log";
    /** 查看系统统计 */
    public static final String SYSTEM_VIEW_STATS = "system:view_stats";

    // ==================== 超级权限 ====================
    /** 超级管理员通配符权限 */
    public static final String ALL = "*:*";

    // ==================== 资源类型 ====================
    public static final String RESOURCE_FILE = "file";
    public static final String RESOURCE_FOLDER = "folder";
    public static final String RESOURCE_KB = "kb";
    public static final String RESOURCE_DIALOG = "dialog";
    public static final String RESOURCE_USER = "user";
    public static final String RESOURCE_SYSTEM = "system";

    // ==================== 操作类型 ====================
    public static final String ACTION_READ = "read";
    public static final String ACTION_CREATE = "create";
    public static final String ACTION_UPDATE = "update";
    public static final String ACTION_DELETE = "delete";
    public static final String ACTION_MANAGE = "manage";

    // ==================== 角色代码 ====================
    public static final String ROLE_MEMBER = "member";
    public static final String ROLE_DEPT_ADMIN = "dept_admin";
    public static final String ROLE_SENIOR_MANAGER = "senior_manager";
    public static final String ROLE_SYSTEM_ADMIN = "system_admin";

    // ==================== 隐私级别 ====================
    public static final String PRIVACY_PRIVATE = "privacy";
    public static final String PRIVACY_SHARED = "shared";
    public static final String PRIVACY_PUBLIC = "public";

    private PermissionConstants() {
        // 工具类禁止实例化
    }
}
